package com.jiawa.wiki.controller;

import com.jiawa.wiki.domain.Test;
import com.jiawa.wiki.service.TestService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TestController {


    @Value("${test.hello}")
    private String testhello;


    @GetMapping("/hello")
    public String hello(){
        return "helloworld"+testhello;
   }

    @PostMapping("/hello/post")
    public String hellopost(String name){
        return "helloworld"+name+testhello;
}

    @Resource
    private TestService testService;

    @GetMapping("/test/list")
    public List<Test> list(){
        return testService.list();
    }

}

